package com.romotc.json.tools;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.JsonDeserializer;
import org.codehaus.jackson.map.JsonSerializer;
/**
 * 反序列化自定义时间转换 未实现
 * @author romotc
 *
 */
public class CustomDateDeSerializer extends JsonDeserializer<Date> {
	private String dateFormat = "yyyy-MM-dd-HH-mm-ss";
	public CustomDateDeSerializer() {
		
	}
	
	/**
	 * 自定义日期格式
	 * @param dateFormat
	 */
	public CustomDateDeSerializer(String dateFormat) {
		this.dateFormat = dateFormat;
	}
	
	@Override
	public Date deserialize(JsonParser jp, DeserializationContext ctxt)
			throws IOException, JsonProcessingException {
		// TODO Auto-generated method stub
        SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);  
//        String formattedDate = formatter.format(value);  
//        jgen.writeString(formattedDate);  
		return null;
	}

}
